package com.cloud.lan.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.lan.entity.model.dataobject.LanActivityDO;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 兑换码活动信息表 Mapper 接口
 * </p>
 *
 * @author xyqierkang@163.com
 * @since 2021-12-23
 */
@Mapper
public interface LanActivityMapper extends BaseMapper<LanActivityDO> {

    @Select("select la.*\n" +
            "    from lan_activity la\n" +
            "    left join lan_activity_record lar on la.id = lar.activity_id where lar.user_id=#{userId}")
    List<LanActivityDO> getActivityUsers(@Param("userId") Long userId);
}
